import { createRouter, createWebHistory } from 'vue-router';

const router = createRouter({
  // 使用 process.env 替代 import.meta.env 来避免模块兼容性问题
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('@/views/Login.vue'),
    },
    {
      path: '/register',
      name: 'register',
      component: () => import('@/views/Register.vue'),
    },
    {
      path: '/matplotlib',
      name: 'home',
      component: () => import('@/views/matplotlib.vue'),
    },
    {
      path: '/seaborn',
      name: 'seaborn',
      component: () => import('@/views/seaborn.vue'),
    },
    {
      path: '/pyecharts',
      name: 'pyecharts',
      component: () => import('@/views/pyecharts.vue'),
    },
  ],
});

export default router;
